package com.sc.byahi.user.shared;

import java.util.ArrayList;
import java.util.List;

/**
 * This is the uploaded image id, which needs to be resized and assigned to original upload. 
 * @author Admin
 * @deprecated
 */
public class Image extends AbstractEntity<Long> {
	private static final long serialVersionUID = 1L;
	protected Long id = null;
	private Long profileId;
	private String imageKey;
	private String imageResizedKey;


	public static final String PROFILE_ID = "profileId";
	public static final String IMAGE_KEY = "imageKey";
	public static final String IMAGE_RESIZED_KEY = "imageResizedKey";
	
	@Override
	public List<String> getUnindexedPropertyNames() {
		List<String> props = new ArrayList<String>();
		props.add(PROFILE_ID);
		props.add(IMAGE_KEY);
		return props;
	}

	@Override
	public List<String> getIndexedPropertyNames() {
		List<String> props = new ArrayList<String>();
		props.add(IMAGE_RESIZED_KEY);
		return props;
	}
	
	@Override
	public Object getProperty(String key) {
		if (PROFILE_ID.equals(key)) {
			return getProfileId();
		}
		if (IMAGE_KEY.equals(key)) {
			return getImageKey();
		}
		if (IMAGE_RESIZED_KEY.equals(key)) {
			return getImageResizedKey();
		}
		return null;
	}
	
	@Override
	public void setProperty(String key, Object value) {
		if (PROFILE_ID.equals(key)) {
			setProfileId((Long) value);
		}
		if (IMAGE_KEY.equals(key)) {
			setImageKey((String) value);
		}
		if (IMAGE_RESIZED_KEY.equals(key)) {
			setImageResizedKey((String) value);
		}
	}


	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		if (id != null){
			this.id = id;
		}
	}
	public Long getProfileId() {
		return profileId;
	}

	public void setProfileId(Long profileId) {
		this.profileId = profileId;
	}

	public String getImageKey() {
		return imageKey;
	}

	public void setImageKey(String imageKey) {
		this.imageKey = imageKey;
	}

	public String getImageResizedKey() {
		return imageResizedKey;
	}

	public void setImageResizedKey(String imageResizedKey) {
		this.imageResizedKey = imageResizedKey;
	}

}
